import { statusList } from '@/utils/enums'

export const statusEnums = {
  1: '开启',
  2: '关闭'
}
export const typeEnums = {
  1: '金额',
  2: '占比'
}
export const typeList = [
  { label: '金额', value: 1 },
  { label: '占比', value: 2 }
]
/** 表格 */
export const tableColumns = [
  {
    label: '分成对象',
    prop: 'name'
  },
  {
    label: '分成类型',
    prop: 'type',
    filter: (val) => typeEnums[val]
  },
  {
    label: '分成金额',
    prop: 'value',
    slotName: 'value'
  },
  {
    label: '生效日期',
    prop: 'date'
  },
  {
    label: '操作',
    prop: 'operation',
    slotName: 'operation'
  }
]

/** 新增 编辑 */
export const aFormData = {
  name: '',
  type: 1,
  value: ''
}
export const aFormConfig = [
  {
    type: 'input',
    prop: 'name',
    label: '分成对象',
    span: 24,
    clearable: true,
    disabled: true
  },
  {
    type: '',
    prop: 'type',
    label: '分成类型',
    span: 24,
    options: typeList,
    slotName: 'type',
  },
  {
    type: '',
    prop: 'value',
    label: '分成金额',
    span: 24,
    slotName: 'value',
  }
]
export const aFormRules = {
  name: [{ required: true, message: '请输入分成名称', trigger: 'blur' }],
  type: [{ required: true, message: '请选择分成类型', trigger: 'change' }],
  value: []
}
